package zhaomh.zhlib.events.impl;

import zhaomh.zhlib.events.Cancellable;

/**
 * 玩家（自己）发送消息时，触发的事件
 */
public class ChatEvent extends Cancellable {
    private String message;
    private boolean addToHistory;
    public ChatEvent(String message, boolean addToHistory) {
        this.message = message;
        this.addToHistory = addToHistory;
    }

    /**
     * @return 是否添加聊天历史
     */
    public boolean isAddToHistory() {
        return addToHistory;
    }

    /**
     * 是否添加聊天历史
     */
    public void setAddToHistory(boolean addToHistory) {
        this.addToHistory = addToHistory;
    }

    /**
     * @return 玩家（自己）发送的消息
     */
    public String getMessage() {
        return message;
    }

    /**
     * 更改发送的消息内容
     */
    public void setMessage(String message) {
        this.message = message;
    }
}
